Repository navigation
Grouped Linear CPU Overhead Reductions By Removing Unnecessary Python Logic - #3613
Conversation
d75052c to
033def7
Compare
a619742 to
c31c2f6
Compare
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryThis PR reduces Python work around grouped linear operations.
The latest changes give packed weights their own quantizer and preserve layouts needed by later training calls. No new actionable issues were found. The earlier, unnumbered Hopper finding is fixed: existing discrete FP8 weights now call Reviews (8) · Last reviewed commit: "Make quantized single grouped weights ow..." · Reviewed by Greptile |
|
/te-ci pytorch |
c7b191c to
ba87a4c
Compare
|
/te-ci pytorch |
Signed-off-by: zhongboz <zhongboz@nvidia.com>
Signed-off-by: zhongboz <zhongboz@nvidia.com>
for more information, see https://pre-commit.ci
Signed-off-by: zhongboz <zhongboz@nvidia.com>
for more information, see https://pre-commit.ci
Signed-off-by: zhongboz <zhongboz@nvidia.com>
Signed-off-by: zhongboz <zhongboz@nvidia.com>
Signed-off-by: zhongboz <zhongboz@nvidia.com>
for more information, see https://pre-commit.ci
Signed-off-by: zhongboz <zhongboz@nvidia.com>
Signed-off-by: Zhongbo Zhu <zhongboz@nvidia.com>
4fc664e to
9c7316d
Compare
|
/te-ci pytorch |
Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <tmoon@nvidia.com>
Disentangle backend selection from quantizer extraction. Remove overly-specific helper function for backend selection. Remove test that calls internal helper functions. Signed-off-by: Tim Moon <tmoon@nvidia.com>
| return [grouped_bias] | ||
| return [getattr(self, f"bias{i}") for i in range(self.num_gemms)] | ||
|
|
||
| def _grouped_tensor_path_supported(self, debug, cpu_offloading, output_quantizers): |
There was a problem hiding this comment.
It's not obvious how this function is different from is_module_grouped_tensor_path_supported. Really, this is entangled with the implementation of forward and it doesn't really stand alone. I've refactored the forward implementation so it's no longer needed.
|
|
||
|
|
||
| @pytest.mark.parametrize("split_alignment", [64, 128]) | ||
| def test_basic_grouped_pre_fuser_split_alignment(monkeypatch, split_alignment): |
There was a problem hiding this comment.
I've removed this test. The module configures the quantizers based on what it needs, and I don't see a reason why that shouldn't be left as an internal detail.
| transformer_engine.common.recipe.Float8CurrentScaling(), | ||
| ], | ||
| ) | ||
| def test_grouped_discrete_weight_quantizers(fp8_recipe): |
There was a problem hiding this comment.
I've modified the test to match TestTrainingLoops.test_linear_training_loop. I'm not a fan of exposing implementation details in the tests unless it's necessary. What we really want is confirmation that the grouped linear op can gracefully switch between enabling and disabling column-wise usages. We can accomplish that by switching between training and inference steps, which has the added benefiit of resembling a real workflow.
Signed-off-by: Tim Moon <tmoon@nvidia.com>
for more information, see https://pre-commit.ci
|
/te-ci pytorch |
|
Document the rowwise usage & columnwise usage under fp8 param in this PR: Why it matters The module/op quantizer expresses the current call’s requirements. The parameter’s internal quantizer must preserve previously enabled usages. If these references point to the same object, changing the module/op quantizer also changes the parameter’s configuration. Copying determines whether those updates are independent. The table below describes the PR snapshot we inspected, with FP8 primary weights and grouped-tensor execution, excluding grouped MLP fusion. c means “this call requires columnwise weight data.” TE behavior AFTER this PR
Here, |
Make sure to set column-wise usage in quantized weight param quantizer during forward pass. Signed-off-by: Tim Moon <tmoon@nvidia.com>
|
/te-ci pytorch |
|
We are seeing a new test failure in
The error disappears when I disable CuTeDSL. It's not a problem with this PR and the CuTeDSL errors should be fixed by now anyways. |
|
@zhongbozhu @ksivaman @timmoon10 can this be cherry-picked to TE 2.21? cc: @erhoo82 |
Description
Please include a brief summary of the changes, relevant motivation and context.
Partly Fixes #2897
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: